home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3643 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.cc.ic.ac.uk!simonh
  2. From: simonh@ic.ac.uk (Dr S.J. Harris)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Mouse Question ???
  5. Date: 30 Jan 1996 14:02:47 GMT
  6. Organization: Imperial College of Science, Technology and Medicine, London
  7. Message-ID: <4el8e7$nk3@oban.cc.ic.ac.uk>
  8. References: <4ek9ap$1q5g@huey.cadvision.com>
  9. NNTP-Posting-Host: cvcgf.cv.ic.ac.uk
  10.  
  11. In article <4ek9ap$1q5g@huey.cadvision.com> Denis Roux <caddsolu@cadvision.com> writes:
  12. >I would like to know which functions do I have to use to have the mouse in 
  13. >my programs ?
  14. >                       Thanks
  15. >
  16.  
  17. Well,
  18.  
  19.    you could do the following (can't remember the function names ;^):
  20.  
  21.     1. enable your X window for input
  22.     2. set up the events mask for your window to allow mouse
  23.        operations to be reported
  24.     3. repeatedly check the events queue for mouse operations
  25.        and act upon them (not forgetting to operate on other
  26.        events too, of course)
  27.  
  28.    or,
  29.  
  30.     you could call system interrupt 0x33 via your int86()
  31.     function, which will probably be prototyped in dos.h.
  32.     You will of course have to find out what all the mouse
  33.     sub-function codes are...
  34.  
  35.    or,
  36.  
  37.     you could check the serial data stream of the port that
  38.     your mouse is connected onto (assuming you know the
  39.     transmission protocol for your mouse - different mice
  40.     work differently!)
  41.  
  42.    or, ...
  43.  
  44. really, there are no *standard* ways of reading mouse input since
  45. standard C does not know about such things as mice. Besides, mice
  46. are one of those completely non-standard things that require
  47. different functions to be used for different types of system (and
  48. different operating systems on the same system). You would be
  49. better off asking in a group devoted to your system/operating system.
  50.  
  51. Regards,
  52.  
  53. Simon.
  54.  
  55.